const fs = require("fs");
const path = require("path");

// 把2.txt的内容读出来放入4.txt中

var filePath = path.join(__dirname, "/2.txt");

var readable = fs.createReadStream(filePath);
var writeable = fs.createWriteStream(path.join(__dirname, "/4.txt"));

readable.pipe(writeable);